cmake_minimum_required(VERSION 3.5.0)
project(trajectory_generation_helper)

if(NOT CMAKE_CXX_STANDARD)
  set(CMAKE_CXX_STANDARD 14)
  set(CMAKE_CXX_STANDARD_REQUIRED ON)
endif()

find_package(ament_cmake REQUIRED)
find_package(rclcpp REQUIRED)
find_package(geometry_msgs REQUIRED)
find_package(nav_msgs REQUIRED)
find_package(rotor_swarm_msgs REQUIRED)
find_package(quadrotor_common REQUIRED)
find_package(polynomial_trajectories REQUIRED)
find_package(Eigen3 REQUIRED)

include_directories(${EIGEN3_INCLUDE_DIRS})
include_directories("/usr/include/eigen3")
include_directories(
	include
	# 非非非非常重要，下面这个绝对路径，是poly_traj_helper.h里引用poly_traj_settings.h编译成功的必须条件，否则它死活找不到polynomial_trajectory.h
	/home/zyh/Codes/RotorsSwarm/rotors_swarm/install/polynomial_trajectories/include/polynomial_trajectories/
    ${rotor_swarm_msgs_INCLUDE_DIRS}
    ${quadrotor_common_INCLUDE_DIRS}
	${polynomial_trajectories_INCLUDE_DIRS}
    )

add_library(trajectory_generation_helper SHARED
	src/circle_trajectory_helper.cpp
	src/heading_trajectory_helper.cpp
	src/polynomial_trajectory_helper.cpp
	# include/trajectory_generation_helper/circle_trajectory_helper.h
	# include/trajectory_generation_helper/heading_trajectory_helper.h
	# include/trajectory_generation_helper/polynomial_trajectory_helper.h
	include/circle_trajectory_helper.h
	include/heading_trajectory_helper.h
	include/polynomial_trajectory_helper.h
)

ament_target_dependencies(
	trajectory_generation_helper
	"rclcpp"
	"geometry_msgs"
	"nav_msgs"
	"rotor_swarm_msgs"
	"quadrotor_common"
	"polynomial_trajectories"
	"Eigen3"
	)

ament_export_targets(trajectory_generation_helper HAS_LIBRARY_TARGET)
ament_export_dependencies(rclcpp)

install(
	TARGETS trajectory_generation_helper
	EXPORT trajectory_generation_helper
	ARCHIVE DESTINATION lib
	LIBRARY DESTINATION lib
	RUNTIME DESTINATION bin
	INCLUDES DESTINATION include
	)

install(
	DIRECTORY include/
	DESTINATION include/${PROJECT_NAME}
	# DESTINATION include
	)

ament_package()


